﻿@using Resource = Resources.Views.Shared.LoginPartial

@if (Request.IsAuthenticated)
{
    using (Html.BeginForm("LogOff", "Account", new { area = string.Empty }, FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" }))
    {
        @Html.AntiForgeryToken()

        <ul class="nav navbar-nav navbar-right">
            <li>
                @{  
                    var welcomeMessage = string.Format("{0}, {1}!", Resource.Welcome_message, User.Identity.Name);
                }
                @Html.ActionLink(welcomeMessage, GlobalConstants.Index, "Profile", new { area = "Users" }, new { title = Resource.Settings, @class = "text-primary" })
            </li>
            <li><a href="javascript:document.getElementById('logoutForm').submit()">@Resource.Log_out</a></li>
        </ul>
    }
}
else
{
    <ul class="nav navbar-nav navbar-right">
        <li>@Html.ActionLink(Resource.Register, "Register", "Account", new { area = string.Empty }, htmlAttributes: new { id = "registerLink" })</li>
        <li>@Html.ActionLink(Resource.Log_in, "Login", "Account", new { area = string.Empty }, htmlAttributes: new { id = "loginLink" })</li>
    </ul>
}
